package org.wmq.taskschedule.factory;

import org.springframework.beans.BeanUtils;
import org.wmq.taskschedule.algorithm.AlgorithmExecutor;
import org.wmq.taskschedule.algorithm.ImageResizeExecutor;
import org.wmq.taskschedule.biz.model.DO.Param;

/**
 * 图像缩放算法执行器工厂类
 * 实现AlgorithmExecutorFactory接口，用于创建ImageResizeExecutor实例
 */
public class ImageResizeExecutorFactory implements AlgorithmExecutorFactory {
    private static final ImageResizeExecutorFactory instance = new ImageResizeExecutorFactory();

    private ImageResizeExecutorFactory() {}
    
    /**
     * 获取工厂实例
     * @return ImageResizeExecutorFactory实例
     */
    public static ImageResizeExecutorFactory getInstance() {
        return instance;
    }
    
    @Override
    public AlgorithmExecutor getAlgorithmExecutor(Param param) {
        ImageResizeExecutor imageResizeExecutor = new ImageResizeExecutor();
        BeanUtils.copyProperties(param, imageResizeExecutor);
        return imageResizeExecutor;
    }
}